<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
    <div>
    </div>

    <script>
        function test() {
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    reject('出错了')
                }, 500)
            })
        }
        async function f() {
            await test();
            console.log('上面的await返回了rejected状态')
            await Promise.resolve(456);
        }

        f().then(v => console.log(v)).catch(e => console.log('有错误'))
    </script>
</body>

</html>